package com.jrapider.manager.data.om;

import com.baomidou.mybatisplus.annotation.*;
import com.jrapider.CommonConstants;
import com.jrapider.compent.dict.DictTranslater;
import lombok.Getter;
import lombok.Setter;

@TableName("sys_menu")
@Getter
@Setter
public class SysMenu extends _SysMenu {
    @TableField(exist = false)
    private String link;

    public String getTreeTitle(){
        StringBuilder sb = new StringBuilder();
        for(int i=2;i<sortcode.length();i=i+2){
            sb = sb.append("+---");
        }
        sb = sb.append("+>&nbsp;&nbsp;");
        return sb.append(title).toString();
    }
    public String getLinkCN() {
        return DictTranslater.getNote(CommonConstants.DICT_LINK, link);
    }

    public String getStateCN() {
        return DictTranslater.getNote(CommonConstants.DICT_TF, state);
    }

    public String getPidCN() {
        return DictTranslater.getNote("menu", pid);
    }

}
